package com.hk.web.area.controller;

import com.hk.area.service.ChAreaService;
import com.hk.commons.base.BaseController;
import com.hk.commons.vo.JsonResult;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 中国省市区表(ChArea)表控制层
 *
 * @author cyq
 * @since 2020-04-15 09:56:16
 */
@RestController
@RequestMapping("/chArea")
public class ChAreaController extends BaseController {
    /**
     * 服务对象
     */
    @Resource
    private ChAreaService chAreaService;

    @Autowired
    private AmqpTemplate amqpTemplate;

    /**
     * /chArea/province
     *
     * @return
     */
    @GetMapping("/province")
    public JsonResult getAreas() {
        chAreaService.getAreas();
        return new JsonResult();
    }

    /**
     * /chArea/send
     * @return
     */
    @GetMapping("/send")
    public JsonResult sendMsg(){
        String s = "机动车综合商业保险免责事项说明书\n";
        String replace = s.replace("\\n", "\\\\n");
        return new JsonResult(replace);
    }



}